/*
============================================================================
 Name        : BlockScrollInfo.h
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : CBlockScrollInfo declaration
============================================================================
*/

#ifndef TRADESCROLLINFO_H
#define TRADESCROLLINFO_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include "BaseBlock.h"
// CLASS DECLARATION

class CTradeScrollInfo : public CBaseBlock
{
public: 
	~CTradeScrollInfo();

	static CTradeScrollInfo* NewL();

	static CTradeScrollInfo* NewLC();

public:
	//from CBlock
	void OnDraw(CFbsBitGc& g);
	void SizeChanged();

	//TInt GetDataLength();
	//TInt16 GetDataType();
	//TBool ReadData(const TDesC8& aData);
	//void WriteData(TDes8& aBuf);
	void OnKeyEvent(TInt keyCode);

public:
	static TInt OnTitleRoll(TAny* aAny);
	
public:	
	void UpdatePosition();
	TRect GetRect(){return m_rect;}
	void StartScroll();
	void ShowScrollInfo(TBool aShow);
	void AppendDesC(const TDesC& buf);

private:
	CTradeScrollInfo();
	void ConstructL();
	void DrawOneSecond(CFbsBitGc& g);
	
public:
	CDesC16ArrayFlat* m_pRollInfo;
	//CDesCArray* m_pstrSummary;
	//CDesCArray* m_pstrTime;

private:
	TInt 		m_nInfoRollTime;
	CPeriodic*	m_AnimationTimer;	//\xD7\xD6\x{013b}\xB9\xF6\xB6\xAF

	TInt m_nYOffset;
	TInt m_nXOffset;
	TInt m_nCurIndex;

	TBuf<32> m_strDefaultRoll;
	TBuf<128> m_strDraw;
	//TBuf<32> m_strStarKey;
	
	CFont* 	iFont;
	TBool	m_bLoading;
	
public:
	inline void SetLoading(TBool b){m_bLoading = b; };
	inline void SetPercent(TInt aPercentage){iDownPercentage = aPercentage;};
	inline TBool GetLoading(){return m_bLoading;};
};

#endif // BLOCKSCROLLINFO_H

